<extend name="Layout/ins_page_nojs" />

<block name="content">
    <!--content begin-->
    <script src="/Public/Scripts/Report/ProfitReportX/jquery/jquery-1.9.1.min.js"></script>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
    <script type="text/javascript" src="/Public/Scripts/Report/ProfitReportX/jquery/tableExport/jquery.base64.js"></script>
    <script type="text/javascript" src="/Public/Scripts/Report/ProfitReportX/jquery/tableExport/tableExport.js"></script>
    <script type="text/javascript" src="/Public/Scripts/Report/ProfitReportX/jquery/tableExport/jspdf/libs/sprintf.js"></script>
    <script type="text/javascript" src="/Public/Scripts/Report/ProfitReportX/jquery/tableExport/jspdf/libs/Mybase64.js"></script>
    <link href="/Public/CSS/Report/ProfitReportX/table1.css" rel="stylesheet" type="text/css" />

    <!--<link href="/sap/demo.css" rel="stylesheet" type="text/css" />-->
    <!--<script src="/sap/scripts/boot.js" type="text/javascript"></script>-->

    </head>
    <body>

    <!--<button class="btn btn-success" onClick ="$('#mytable').tableExport({type: 'excel', escape: 'false',tableName: 'profitcompare'});">导出EXCEL</button>-->
    <input class="btn btn-success" type="submit" name="Submit" value="返回" onclick="window.history.back()" >

    <table border="1"  id="mytable" cellspacing="0" >
        <thead>
        <tr >
            <th  style="width:8%"><div align="center">物料号</div></th><th><div align="center">物料名</div></th><div align="center"><?php if ( $ViewOption=='Everyone') { echo "<th style='width:10%' ><div align=\"center\">平台</div></th>";}?> </div><th  style="width:6%"><div align="center">数量</div></th> <th  style="width:6%"><div align="center">毛利</div></th> <th  style="width:6%" ><div align="center">销售金额</div></th> <th  style="width:6%"><div align="center">库存价值</div></th> <th  style="width:6%"><div align="center">银行费用</div></th> <th  style="width:6%"><div align="center">快递费用</div></th> <th style="width:6%"><div align="center">赠品件数</div></th> <th style="width:6%"><div align="center">赠品成本</div></th>
            <th  style="width:6%"><div align="center">赠品运费</div></th><th  style="width:6%"><div align="center">物流附加</div></th><th  style="width:6%"><div align="center">税</div></th>
        </tr>
        </thead>


        <foreach name="data" item="result">

        <tr align="center">
            <td><?php echo "<a target=\"_blank\" href=\"http://insights.g-town.com.cn:8090/ItemReport/itemReport.php?ItemCode=".$result['ITEMCODE']."&FromDate=".$FromDate."&ToDate=".$ToDate."&CardCodeS=".$result['CardCode']."\">".$result['ITEMCODE']."</a>";?></td>
            <td><?php echo $result['ItemName'];?></td>
            <?php if ( $ViewOption=='Everyone') { echo "<td>".$result['CardName']."</td>";}?>
            <td><?php echo round($result['sumqty'],0);?></td>
            <td><?php if (round($result['profit'],2)<0){echo "<font color='FF6633'>".round($result['profit'],2)."</font>" ;} else {echo "<font color='000099'>".round($result['profit'],2)."</font>"; } ?></td>
            <td><?php echo round($result['sumprice'],2);?></td>
            <td><?php echo round($result['sumstockprice'],2);?></td>
            <td><?php echo round($result['sumbankfee'],2);?></td>
            <td><?php echo round($result['sumexpress'],2);?></td>
            <td><?php echo round($result['sumgift'],2);?></td>
            <td><?php echo round($result['sumgiftprice'],2);?></td>
            <td><?php echo round($result['sumgiftaddexpressfee'],2);?></td>
            <td><?php echo round($result['sumaddstockfee'],2);?></td>
            <td><?php echo round($result['sumtax'],2);?></td>
        </tr>

        </foreach>

    </table>
    <input type="submit" class="btn btn-success"  name="Submit" value="返回" onclick="window.history.back()" >
    <!--<button class="btn btn-success" onClick ="$('#mytable').tableExport({type: 'excel', escape: 'false'});">导出EXCEL</button>-->

    <script>
        function popItemDetails(sku) {
            mini.open({
                url:  "http://insights.g-town.com.cn:8090/ItemReport/itemReport.php",
                title: "",
                width: 800,
                height: 380,
                ondestroy: function (action) {
                    if (action == "ok") {

                    }

                }
            });

        }
        </script>

</block>